//
//  MethodCollectionViewCell.m
//  FoodFamily
//
//  Created by dlios on 15-6-21.
//  Copyright (c) 2015年 guoBang. All rights reserved.
//

#import "MethodCollectionViewCell.h"

@implementation MethodCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self FoodMETHOD];
    }


    return self;
    
}
-(void)FoodMETHOD
{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
    view.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:view];
    self.myimageview = [[UIImageView alloc]initWithFrame:CGRectMake(05, 05, self.contentView.frame.size.width-10, self.contentView.frame.size.height-40)];
    self.myimageview.backgroundColor = [UIColor clearColor];
    [view addSubview:self.myimageview];
    
    
    
    self.order_id = [[UILabel alloc]initWithFrame:CGRectMake(0, 120, 20, 20)];
    self.order_id.font = [UIFont systemFontOfSize:13];
    self.order_id.layer.masksToBounds = YES;
    self.order_id.textAlignment = NSTextAlignmentCenter;//label剧中
    self.order_id.layer.cornerRadius = 8;
    self.order_id.backgroundColor= [UIColor colorWithRed:243/255.0 green:231/255.0 blue:213/255.0 alpha:1];
    
    self.order_id.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    //self.order_id.layer.cornerRadius = 0;
    [view addSubview:self.order_id];
    self.describe = [[UILabel alloc]initWithFrame:CGRectMake(20, 115, 80, 35)];
    self.describe.backgroundColor = [UIColor clearColor];
    self.describe.textColor = [UIColor blackColor];
    self.describe.font = [UIFont systemFontOfSize:11];
    self.describe.numberOfLines = 0;
    [view addSubview:self.describe];


}
-(void)setMovie:(Movie *)movie
{
    if (_movie != movie) {
        [_movie release];
        _movie = [movie retain];
    }
    self.order_id.text = movie.order_id;
    self.describe.text = movie.describe;
    NSURL *url = [NSURL URLWithString:movie.imagePath];
    [self.myimageview sd_setImageWithURL:url];
        
}

@end
